package com.atguigu.carousel.controller;

import com.atguigu.carousel.service.CarouselService;
import com.atguigu.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * 轮播图的控制类
 */

@RestController
@RequestMapping("carousel")

public class CarouselController {

    @Autowired
    private CarouselService carouselService;

    /**
     * 查询首页数据,查询优先级最高的四条
     * @return
     */

    @PostMapping("list")
    public R list(){
        return carouselService.list();
    }

}

